home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / graphics / gnuplot / contrib / campbell / gplotlib.1 < prev    next >
Encoding:
Internet Message Format  |  1992-04-27  |  52.5 KB

  1. From jdc@naucse.cse.nau.edu Thu Mar  5 09:26:35 1992
  2. Return-Path: <jdc@naucse.cse.nau.edu>
  3. Received: from naucse.cse.nau.edu by ra-next.arc.nasa.gov (NeXT-1.0 (From Sendmail 5.52)/NeXT-1.0)
  4.     id AA10623; Thu, 5 Mar 92 09:26:21 PST
  5. Received: by naucse.cse.nau.edu (5.65c/1.5-nau)
  6.     id AA21522; Thu, 5 Mar 1992 10:32:12 -0700
  7. Message-Id: <199203051732.AA21522@naucse.cse.nau.edu>
  8. From: jdc@naucse.cse.nau.edu (John Campbell)
  9. Date: Thu, 5 Mar 1992 10:32:09 MST
  10. X-Mailer: Mail User's Shell (7.2.3 5/22/91)
  11. To: woo@ra-next.arc.nasa.gov
  12. Subject: gplotlib.shr1
  13. Status: R
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 1 (of 5)."
  22. # Contents:  000alpha.notes 000announce Makefile Makefile.ult bar.doc
  23. #   bar.t1 bar.t2 bar.t3 bar.t4 bar.t5 bar.t6 bar.t7 bars.c docu.c
  24. #   getopt.c gsr.h gtplot.h gutil.c makefile.3b1 makefile.ult
  25. #   makefile.unx
  26. # Wrapped by jdc@naucse.cse.nau.edu on Tue Feb 11 08:42:11 1992
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f '000alpha.notes' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'000alpha.notes'\"
  30. else
  31. echo shar: Extracting \"'000alpha.notes'\" \(2676 characters\)
  32. sed "s/^X//" >'000alpha.notes' <<'END_OF_FILE'
  33. X
  34. X000alpha.notes:
  35. X
  36. XInitial version  --- jdc  3/19/90
  37. X
  38. XYou're looking at gplotlib--an accompaniment to gnuplot that I'm thinking 
  39. Xabout posting someday.  Put the files in this shar package into a directory 
  40. Xcalled ``gplotlib'' under the normal gnuplot source directory.  (This is to 
  41. Xallow the Makefile to find ../term where the terminal routines are expected 
  42. Xto live.)
  43. X
  44. XRight now the gplotlib library consists of two files: low level routines 
  45. X(gterm.c), and "high level" routines (gsr.c).  In addition, there is some 
  46. Xdocumentation (make doc) and examples: bars.c (using low level routines only)
  47. Xand bar.c (using a mix of high and low level routines).
  48. X
  49. XThe "high level" routines are mostly untested.  The assortment presented 
  50. Xis merely those that appeared after mucking with the gnuplot graphics.c 
  51. Xcode.  Thus the library isn't really thought out or designed with any
  52. Xidea in mind that these are actually routines needed by users, rather they 
  53. Xare just the routines that gnuplot itself would have probably needed if it 
  54. Xhad been written with an underlying library in mind.  Using these gsr 
  55. Xroutines tends to create plots that look a lot like gnuplot plots.
  56. X
  57. XCertainly there is a lot of room for improvement here.  Many design
  58. Xquestions arise: Should, for example, there be a gsr_draw_line()
  59. Xroutine?  Or even, should there be a whole new direction or module
  60. Xof graphics support?  One thing does seem true, however: with these
  61. Xroutines the terminal drivers are now at least available to programmers.
  62. X
  63. XThe bar.c program is not really finished.  I'm not sure what else
  64. Xit needs, however, since I don't use bar charts myself.  It provides
  65. Xa pragmatic example of using these two libraries in an intimate, but
  66. Xprobably not very clean, manner.  I expect bar.c could profit from
  67. Xhaving better labels, and some method of assigning labels to the
  68. Xplot.  Further, bars.c puts a small gap between the top of the highest
  69. Xbar and the boundary while bar.c does not do this.
  70. X
  71. XThe makefile mentions pie.c--which is going to be a pie chart graphics
  72. Xprogram.  This hasn't, however, been written.  I assume it too will
  73. Xbe a hodge-podge mix of gsr and gterm routines.  In particular, the
  74. Xnumber of segments chosen to draw a circle will probably depend
  75. Xupon t->xmax and t->ymax to maximize the effect on a given terminal.
  76. X
  77. XWorking on various graphics projects is the only way I know to tell
  78. Xif we are getting at all close to a usable library package.  I'm sure
  79. Xthere is a lot missing from this first edition...  Any help or suggestions
  80. Xwould be greatly appreciated.
  81. X
  82. XJohn Campbell
  83. X...arizona!naucse!jdc   
  84. X-or CAMPBELL@NAUVAX.bitnet
  85. X-or (for small mail items only)- ...arizona!naucse!thunde!jdc
  86. END_OF_FILE
  87. if test 2676 -ne `wc -c <'000alpha.notes'`; then
  88.     echo shar: \"'000alpha.notes'\" unpacked with wrong size!
  89. fi
  90. # end of '000alpha.notes'
  91. fi
  92. if test -f '000announce' -a "${1}" != "-c" ; then 
  93.   echo shar: Will not clobber existing file \"'000announce'\"
  94. else
  95. echo shar: Extracting \"'000announce'\" \(1378 characters\)
  96. sed "s/^X//" >'000announce' <<'END_OF_FILE'
  97. X
  98. XThis is to solicit alpha users willing to look at an experimental
  99. Xgnuplot library I've created called gplotlib.  At this point gplotlib
  100. Xis merely an experiment and there is no reason at all to think it will
  101. Xever make it into the gnuplot distribution.  On the other hand, I did
  102. Xthe work hoping one day it might grow into something useful.
  103. X
  104. XGplotlib uses the terminal drivers and a slightly modified term.c
  105. Xpiece of code to provide programmers easy access to all those nice 
  106. Xterminal drivers in gnuplot.  A friend got me started on this with the 
  107. Xidea of making graphs in a public domain spread sheet package.  Right 
  108. Xnow the only program written with this library is a bar chart program 
  109. Xthat exists mostly to show how to use the library (although it does as 
  110. Xpromised and will generate bar charts).
  111. X
  112. XDon't expect a very polished product right now.  The documentation
  113. Xlives mostly in the source code and the makefiles are fairly untested.
  114. XStill, for an alpha package, it's not that horrible.
  115. X
  116. XDave Kotz was nice enough to give me space on his cs.duke.edu machine,
  117. Xso if you have ftp access you can pick this up as ~pub/gplotlib.tar.Z
  118. Xon cs.duke.edu.  Otherwise you can ask for a shar file from me:
  119. X
  120. XThanks,
  121. X-------
  122. X    John Campbell               ...!arizona!naucse!jdc
  123. X                                    CAMPBELL@NAUVAX.bitnet
  124. X    unix?  Sure send me a dozen, all different colors.
  125. END_OF_FILE
  126. if test 1378 -ne `wc -c <'000announce'`; then
  127.     echo shar: \"'000announce'\" unpacked with wrong size!
  128. fi
  129. # end of '000announce'
  130. fi
  131. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  132.   echo shar: Will not clobber existing file \"'Makefile'\"
  133. else
  134. echo shar: Extracting \"'Makefile'\" \(1658 characters\)
  135. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  136. X#
  137. X# GNUPLOT Makefile for ATT 3b1 (ATT 7300 or the "unix-PC")
  138. X#
  139. X# Note: this makefile uses the shared library
  140. X#
  141. X
  142. X# Well, man page needs to be generated out of source code for library
  143. X# somehow...
  144. XMANDEST=/usr/man/manl
  145. X
  146. X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
  147. X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset()
  148. X# -DNOCOPY if you don't have a memcpy() by any name
  149. X# -O if you trust your compiler's optimizer
  150. XCC = cc 
  151. X
  152. XCFLAGS = -g -DNOCWDRC -DGETCWD -DMEMSET -DMEMCPY -DNOVFORK -I..
  153. X
  154. X#TERMFLAGS =  -I../term -DUNIXPC
  155. XTERMFLAGS =  -DUNIXPC
  156. X
  157. X# These object files form the gplotlib.ar library
  158. XOBJS = gsr.o gterm.o gutil.o ../bitmap.o 
  159. X
  160. X# -lplot iff you have -DUNIXPLOT
  161. X# -lsuntool -lsunwindow -lpixrect  iff you have -DSUN
  162. X# -lgl_s if IRIS4D
  163. XLIBS = -lm -lplot
  164. X
  165. Xbar: $(OBJS) bar.o
  166. X    ld /lib/crt0s.o /lib/shlib.ifile bar.o $(OBJS) $(LIBS) -o bar
  167. X
  168. Xbars: $(OBJS) bars.o
  169. X    ld /lib/crt0s.o /lib/shlib.ifile bars.o $(OBJS) $(LIBS) -o bars
  170. X
  171. Xpie: $(OBJS) pie.o
  172. X    ld /lib/crt0s.o /lib/shlib.ifile pie.o $(OBJS) $(LIBS) -o pie 
  173. X
  174. Xall:    bar pie
  175. X
  176. Xgterm.o: ../term/*.trm gterm.c
  177. X    $(CC) $(CFLAGS) $(TERMFLAGS) -c gterm.c
  178. X
  179. X$(OBJS): gtplot.h gsr.h
  180. X
  181. Xclean:
  182. X    rm -f *.o *~ *.*_doc 
  183. X
  184. Xspotless:
  185. X    rm -f *.o *~ TAGS bar bars pie cpr docu *.*_doc gplotlib.doc
  186. X
  187. Xdoc:    docu cpr intro.doc gsr.c gsr.h gterm.c gtplot.h
  188. X    docu <gsr.c >gsr.c_doc
  189. X    docu <gsr.h >gsr.h_doc
  190. X    docu <gterm.c >gterm.c_doc
  191. X    docu <gtplot.h >gtplot.h_doc
  192. X    cpr -ac -C -PBACKSPACE \
  193. X       intro.doc gterm.c_doc gtplot.h_doc gsr.c_doc gsr.h_doc >gplotlib.doc
  194. X    rm -f gsr.c_doc gsr.h_doc gterm.c_doc gtplot.h_doc
  195. X
  196. Xdocu:    docu.c
  197. X    cc docu.c -o docu
  198. X
  199. Xcpr:    cpr.c
  200. X    cc cpr.c -o cpr
  201. X
  202. X
  203. END_OF_FILE
  204. if test 1658 -ne `wc -c <'Makefile'`; then
  205.     echo shar: \"'Makefile'\" unpacked with wrong size!
  206. fi
  207. # end of 'Makefile'
  208. fi
  209. if test -f 'Makefile.ult' -a "${1}" != "-c" ; then 
  210.   echo shar: Will not clobber existing file \"'Makefile.ult'\"
  211. else
  212. echo shar: Extracting \"'Makefile.ult'\" \(3338 characters\)
  213. sed "s/^X//" >'Makefile.ult' <<'END_OF_FILE'
  214. X#
  215. X# GPLOTLIB Makefile for Ultrix
  216. X#
  217. X# Note: Ultrix standard cc compiler has a bug with static structure
  218. X# initializations [such as struct ts {int x;} tb[]={{100*0.32}};]
  219. X# and so this makefile uses vcc instead.  If this isn't possible,
  220. X# and you get "line xx: illegal initialization", then you'll have
  221. X# to go into the .trm include file and compute all the floating point
  222. X# defines with a calculator.
  223. X
  224. X
  225. X# directory where to install executables on 'make install'
  226. XDEST=/usr/local/lib
  227. X# directory for installing man page on 'make man_install'
  228. X# Well, man page needs to be generated out of source code for library
  229. X# somehow...
  230. XMANDEST=/usr/man/manl
  231. X
  232. X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
  233. X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset()
  234. X# -DNOCOPY if you don't have a memcpy() by any name
  235. X# -O if you trust your compiler's optimizer
  236. XCC = cc 
  237. X
  238. XCFLAGS = -DBCOPY -DBZERO -O #-gx 
  239. X
  240. X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
  241. X# -DAED         AED 512 and AED 767
  242. X# -DAPOLLO      Apollo workstations
  243. X# -DBITGRAPH    BBN BitGraph
  244. X# -DDXY800A     Roland DXY800A plotter
  245. X# -DEPSON               Epson LX-800, Star NL-10, NX-1000 and lots of others
  246. X# -DFIG                 Fig graphics language (requires object.h from TransFig)
  247. X# -DHP2648              HP2648, HP2647
  248. X# -DHP26        HP2623A and maybe others
  249. X# -DHP75        HP7580, and probably other HPs
  250. X# -DHPGL                HP7475 and (hopefully) lots of others
  251. X# -DHPLJET              HP Laserjet
  252. X# -DIMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  253. X# -DIRIS4D      IRIS4D series computer
  254. X# -DKERMIT      MS-Kermit Tektronix 4010 emulator
  255. X# -DLATEX       LATEX picture environment
  256. X# -DPOSTSCRIPT  Postscript
  257. X# -DPROPRINTER  IBM Proprinter
  258. X# -DQMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  259. X# -DREGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  260. X# -DSELANAR     Selanar
  261. X# -DTEK         Tektronix 4010, and probably others
  262. X# -DSUN         Sun Microsystems Workstation
  263. X# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
  264. X# -DUNIXPLOT    unixplot
  265. X# -DV384        Vectrix 384 and tandy color printer
  266. X
  267. X# -DEPSON removed just before HP2648.
  268. X
  269. XTERMFLAGS =  -I../term -DAED -DBITGRAPH -DDXY800A -DHP2648 \
  270. X    -DHP26 -DHP75 -DHPGL -DHPLJET -DIMAGEN -DKERMIT -DLATEX \
  271. X    -DPOSTSCRIPT -DPROPRINTER -DQMS -DREGIS -DSELANAR -DTEK \
  272. X    -DUNIXPLOT -DV384
  273. X
  274. X# These object files form the gplotlib.ar library
  275. XOBJS = gsr.o gterm.o 
  276. X
  277. X# -lplot iff you have -DUNIXPLOT
  278. X# -lsuntool -lsunwindow -lpixrect  iff you have -DSUN
  279. X# -lgl_s if IRIS4D
  280. XLIBS = -lm -lplot
  281. X
  282. Xbar: $(OBJS) bar.o
  283. X    vcc bar.o $(OBJS) $(LIBS) -o bar
  284. X
  285. Xbars: $(OBJS) bars.o
  286. X    vcc bars.o $(OBJS) $(LIBS) -o bar
  287. X
  288. Xpie: $(OBJS) pie.o
  289. X    vcc pie.o $(OBJ) $(LIBS) -o bar
  290. X
  291. Xall:    bar pie
  292. X
  293. Xgterm.o: ../term/*.trm gterm.c
  294. X    vcc $(CFLAGS) $(TERMFLAGS) -c gterm.c
  295. X
  296. X$(OBJS): gtplot.h gsr.h
  297. X
  298. Xclean:
  299. X    rm -f *.o *~ *.*_doc 
  300. X
  301. Xspotless:
  302. X    rm -f *.o *~ TAGS bar bars pie cpr docu *.*_doc gplotlib.doc
  303. X
  304. Xdoc:    docu cpr intro.doc gsr.c gsr.h gterm.c gtplot.h
  305. X    docu <gsr.c >gsr.c_doc
  306. X    docu <gsr.h >gsr.h_doc
  307. X    docu <gterm.c >gterm.c_doc
  308. X    docu <gtplot.h >gtplot.h_doc
  309. X    cpr -ac -C -PBACKSPACE \
  310. X       intro.doc gterm.c_doc gtplot.h_doc gsr.c_doc gsr.h_doc >gplotlib.doc
  311. X    rm -f gsr.c_doc gsr.h_doc gterm.c_doc gtplot.h_doc
  312. X
  313. Xdocu:    docu.c
  314. X    cc docu.c -o docu
  315. X
  316. Xcpr:    cpr.c
  317. X    cc cpr.c -o cpr
  318. END_OF_FILE
  319. if test 3338 -ne `wc -c <'Makefile.ult'`; then
  320.     echo shar: \"'Makefile.ult'\" unpacked with wrong size!
  321. fi
  322. # end of 'Makefile.ult'
  323. fi
  324. if test -f 'bar.doc' -a "${1}" != "-c" ; then 
  325.   echo shar: Will not clobber existing file \"'bar.doc'\"
  326. else
  327. echo shar: Extracting \"'bar.doc'\" \(1167 characters\)
  328. sed "s/^X//" >'bar.doc' <<'END_OF_FILE'
  329. X
  330. X   bar plots:
  331. X      bar [-x xlabel] [-y ylabel] [-t title] [-T term] [file [file2 ...]]
  332. X
  333. X
  334. X   data files look like the following:
  335. X
  336. X   100 20
  337. X   300
  338. X   -40.5 35 290 297
  339. X
  340. X   where each value on the line is a new bar and each line creates
  341. X   a gap between bars and starts the pattern used by bars over again.
  342. X
  343. X   Bar is really to demonstrate how to use the gplotlib library.  Note
  344. X   that bar assumes gt_term_init() can identify the terminal (graphics
  345. X   device) to use to generate the bar plot.  Some devices automatically
  346. X   come up (eg Sun workstations) while others need to have the environment
  347. X   variable GNUTERM set (eg GNUTERM=tek_40xx).
  348. X
  349. X   For example, to plot the data in bar.t4 with labels to a NEC black and
  350. X   white printer you would need to do the following (on unix):
  351. X
  352. X   % GNUTERM=nec_cp6m
  353. X   % bar -x months -y stocks -t "Nest Egg" bar.t4 >foo.out
  354. X   % cat foo.out >/dev/rawlp
  355. X   --or alternatively---
  356. X   % bar -x months -y stocks -t Savings -Tnec_cp6m <bar.t4 >/dev/rawlp
  357. X
  358. X   Note that the list of terminals recognized will probably be the same
  359. X   as in gnuplot so you can say ``set terminal'' inside gnuplot to get
  360. X   the list of known terminals.  
  361. X
  362. END_OF_FILE
  363. if test 1167 -ne `wc -c <'bar.doc'`; then
  364.     echo shar: \"'bar.doc'\" unpacked with wrong size!
  365. fi
  366. # end of 'bar.doc'
  367. fi
  368. if test -f 'bar.t1' -a "${1}" != "-c" ; then 
  369.   echo shar: Will not clobber existing file \"'bar.t1'\"
  370. else
  371. echo shar: Extracting \"'bar.t1'\" \(25 characters\)
  372. sed "s/^X//" >'bar.t1' <<'END_OF_FILE'
  373. X100
  374. X20
  375. X300
  376. X40
  377. X35
  378. X290
  379. X297
  380. END_OF_FILE
  381. if test 25 -ne `wc -c <'bar.t1'`; then
  382.     echo shar: \"'bar.t1'\" unpacked with wrong size!
  383. fi
  384. # end of 'bar.t1'
  385. fi
  386. if test -f 'bar.t2' -a "${1}" != "-c" ; then 
  387.   echo shar: Will not clobber existing file \"'bar.t2'\"
  388. else
  389. echo shar: Extracting \"'bar.t2'\" \(54 characters\)
  390. sed "s/^X//" >'bar.t2' <<'END_OF_FILE'
  391. X5
  392. X10
  393. X15
  394. X20
  395. X25
  396. X30
  397. X35
  398. X40
  399. X45
  400. X50
  401. X50
  402. X40
  403. X35
  404. X22
  405. X17
  406. X12
  407. X11
  408. X9
  409. X2
  410. END_OF_FILE
  411. if test 54 -ne `wc -c <'bar.t2'`; then
  412.     echo shar: \"'bar.t2'\" unpacked with wrong size!
  413. fi
  414. # end of 'bar.t2'
  415. fi
  416. if test -f 'bar.t3' -a "${1}" != "-c" ; then 
  417.   echo shar: Will not clobber existing file \"'bar.t3'\"
  418. else
  419. echo shar: Extracting \"'bar.t3'\" \(59 characters\)
  420. sed "s/^X//" >'bar.t3' <<'END_OF_FILE'
  421. X5
  422. X10
  423. X-15
  424. X20
  425. X25
  426. X30
  427. X35
  428. X-40
  429. X45
  430. X50
  431. X50
  432. X40
  433. X35
  434. X-22
  435. X17
  436. X-12
  437. X11
  438. X9
  439. X-2
  440. END_OF_FILE
  441. if test 59 -ne `wc -c <'bar.t3'`; then
  442.     echo shar: \"'bar.t3'\" unpacked with wrong size!
  443. fi
  444. # end of 'bar.t3'
  445. fi
  446. if test -f 'bar.t4' -a "${1}" != "-c" ; then 
  447.   echo shar: Will not clobber existing file \"'bar.t4'\"
  448. else
  449. echo shar: Extracting \"'bar.t4'\" \(133 characters\)
  450. sed "s/^X//" >'bar.t4' <<'END_OF_FILE'
  451. X5 11 11
  452. X10 12 6
  453. X-15 2 5
  454. X20 7
  455. X25 20
  456. X30 12
  457. X35 11
  458. X-40 11 6 -10 -6 11
  459. X45 10
  460. X50 10
  461. X50 10
  462. X40 19
  463. X35 12
  464. X-22 13
  465. X17 13
  466. X-12 12
  467. X11 14
  468. X9 1
  469. X-2 -12
  470. END_OF_FILE
  471. if test 133 -ne `wc -c <'bar.t4'`; then
  472.     echo shar: \"'bar.t4'\" unpacked with wrong size!
  473. fi
  474. # end of 'bar.t4'
  475. fi
  476. if test -f 'bar.t5' -a "${1}" != "-c" ; then 
  477.   echo shar: Will not clobber existing file \"'bar.t5'\"
  478. else
  479. echo shar: Extracting \"'bar.t5'\" \(66 characters\)
  480. sed "s/^X//" >'bar.t5' <<'END_OF_FILE'
  481. X10 12 3
  482. X20 7 20 5 10
  483. X25 20 11
  484. X35 11
  485. X45 10
  486. X50 10
  487. X40 19
  488. X35 12
  489. X17 13
  490. END_OF_FILE
  491. if test 66 -ne `wc -c <'bar.t5'`; then
  492.     echo shar: \"'bar.t5'\" unpacked with wrong size!
  493. fi
  494. # end of 'bar.t5'
  495. fi
  496. if test -f 'bar.t6' -a "${1}" != "-c" ; then 
  497.   echo shar: Will not clobber existing file \"'bar.t6'\"
  498. else
  499. echo shar: Extracting \"'bar.t6'\" \(90 characters\)
  500. sed "s/^X//" >'bar.t6' <<'END_OF_FILE'
  501. X5 11 11 3 8 20 25 31 18
  502. X10 12 6 12 5 21
  503. X20 7 10 8 3 22
  504. X35 11 8 4 25 23
  505. X-40 11 6 -10 -6 11
  506. END_OF_FILE
  507. if test 90 -ne `wc -c <'bar.t6'`; then
  508.     echo shar: \"'bar.t6'\" unpacked with wrong size!
  509. fi
  510. # end of 'bar.t6'
  511. fi
  512. if test -f 'bar.t7' -a "${1}" != "-c" ; then 
  513.   echo shar: Will not clobber existing file \"'bar.t7'\"
  514. else
  515. echo shar: Extracting \"'bar.t7'\" \(105 characters\)
  516. sed "s/^X//" >'bar.t7' <<'END_OF_FILE'
  517. X.5 .11 .11 
  518. X.10 .12 .6
  519. X.20 .7 .10
  520. X.35 .11 .08
  521. X-.1 .11 .6
  522. X.10 .02 .03
  523. X.03 -.10 .11
  524. X.07 .08 .09
  525. X.5 .03 .25
  526. END_OF_FILE
  527. if test 105 -ne `wc -c <'bar.t7'`; then
  528.     echo shar: \"'bar.t7'\" unpacked with wrong size!
  529. fi
  530. # end of 'bar.t7'
  531. fi
  532. if test -f 'bars.c' -a "${1}" != "-c" ; then 
  533.   echo shar: Will not clobber existing file \"'bars.c'\"
  534. else
  535. echo shar: Extracting \"'bars.c'\" \(6602 characters\)
  536. sed "s/^X//" >'bars.c' <<'END_OF_FILE'
  537. X#include <stdio.h>
  538. X#include <math.h>
  539. X#include "gtplot.h"
  540. X
  541. Xmain(argc, argv)
  542. Xint argc;
  543. Xchar *argv[];
  544. X{
  545. X   FILE *in, *fopen();
  546. X   struct termentry *t;
  547. X
  548. X   if (argc > 2) 
  549. X      usage();
  550. X
  551. X   if (argc == 0)
  552. X      in = stdin;
  553. X   else if ((in = fopen (argv[1], "r")) == NULL) {
  554. X      fprintf (stderr, "Can't open %s\n", argv[1]);
  555. X      exit();
  556. X   }
  557. X
  558. X   GToutfile = stdout;
  559. X/* 
  560. X   still missing the signal handler--especially to make sure we
  561. X   always reset the terminal before we leave on the signals that
  562. X   gnuplot normally traps (2 of them).
  563. X*/
  564. X   gt_init_terminal();  /* Hope we set term here--if not need too later. */
  565. X   if (!GTterm) {
  566. X      fprintf (stderr, "Sorry, unknown terminal type\n");
  567. X      exit(1);
  568. X   }
  569. X   t = >term_tbl[GTterm];
  570. X#ifdef WAIT
  571. X  gt_test_term(); 
  572. X#endif
  573. X   bar_graph(in);
  574. X   getchar();
  575. X   (*t->reset)();
  576. X}
  577. X
  578. Xbar_graph(in)
  579. XFILE *in;
  580. X/* 
  581. X   Routine to make a bar graph out of a list of points.  The list of
  582. X   points come from the file named on the command line.
  583. X   Parameter:
  584. X
  585. X          in:  Pointer to file descriptor containing list of points.
  586. X*/
  587. X{
  588. X#define MAXBUF 255
  589. X   struct termentry *t = >term_tbl[GTterm];
  590. X   int *pnum, bar_w, x_loc, height, lcnt, max_points=t->xmax/2;
  591. X   int err, i, k, result, bar_cnt=0;
  592. X   float *pval, scale, pmax, pmin, dummy;
  593. X   char buf[MAXBUF], *malloc();
  594. X
  595. X/* Read everything into an array of floats with room for 10 per line. */
  596. X   pval = (float *)malloc (10*sizeof(float)*max_points);
  597. X   pnum = (int *)malloc (sizeof(int )*max_points);
  598. X   pmin = VERYLARGE;
  599. X   pmax = -VERYLARGE;
  600. X   err = 0;
  601. X   for (lcnt=0; fgets (buf, MAXBUF, in) != NULL; ++lcnt) {
  602. X      result = sscanf(buf,"%f %f %f %f %f %f %f %f %f %f %f", 
  603. X        &pval[lcnt*10], &pval[lcnt*10+1], &pval[lcnt*10+2], &pval[lcnt*10+3], 
  604. X        &pval[lcnt*10+4], &pval[lcnt*10+5], &pval[lcnt*10+6], &pval[lcnt*10+7], 
  605. X        &pval[lcnt*10+8], &pval[lcnt*10+9], &dummy);
  606. X      if (result > 10) {
  607. X         err = 1;
  608. X         break;
  609. X      }
  610. X   /* Find the max and min of the overall array. */
  611. X      for (k = 0; k < result; ++k) {
  612. X         if (pval[lcnt*10+k] > pmax) pmax = pval[lcnt*10+k];
  613. X         if (pval[lcnt*10+k] < pmin) pmin = pval[lcnt*10+k];
  614. X      }
  615. X      pnum[lcnt] = result;  /* number of items on this line. */
  616. X      bar_cnt += result;
  617. X      if (bar_cnt > max_points) {
  618. X         err = 1;
  619. X         break;
  620. X      }
  621. X   }
  622. X   if (bar_cnt >= max_points) {
  623. X      fprintf (stderr, "Error on input: more than %d data elements\n", bar_cnt);
  624. X      exit(1);
  625. X   }
  626. X   if (err) {
  627. X      fprintf (stderr, "Error on input: line %d\n", lcnt);
  628. X      exit(1);
  629. X   }
  630. X
  631. X/* Draw the bars represented by the array pval. */
  632. X   bar_draw (pval, pnum, lcnt, pmax, pmin);
  633. X}
  634. X
  635. X
  636. Xusage()
  637. X{
  638. X   fprintf (stderr, "usage: bar [file]\n");
  639. X   exit(1);
  640. X}
  641. X
  642. X
  643. X#define SOLID
  644. X
  645. Xbar_draw (pval, pnum, lcnt, pmax, pmin)
  646. Xfloat pval[], pmax, pmin;
  647. Xint pnum[], lcnt;
  648. X/*
  649. X   Routine to draw the bars represented by values in array pval.
  650. X
  651. X   Parameters:
  652. X
  653. X         pval: array of groups of points to take as bar heights.
  654. X
  655. X         pnum: array of the number of points in the ith bar group.
  656. X
  657. X         lcnt: number of groups (10 at most per group) of bars to draw.
  658. X
  659. X         pcnt: number of points to draw. 
  660. X
  661. X         pmax: largest value in the pval array.
  662. X
  663. X         pmin: smallest value in the pval array.
  664. X*/
  665. X{
  666. X   int i, j, k, bar_cnt, zero, y_loc, bar_h, bar_w, x_loc;
  667. X   float scale, range, yoff=0.0;
  668. X   struct termentry *t = >term_tbl[GTterm];
  669. X
  670. X#define GAP (t->v_char/2)  /* Space between bar and top (or bott) of graph. */
  671. X
  672. X/* Compute scaling factor zero point, etc for this bar graph. */
  673. X   if (pmin < 0.0) {
  674. X   /* Make a gap at the top and at the bottom of the bar graph */
  675. X      range = pmax - pmin;
  676. X      scale = (t->ymax - 2*GAP)/range;
  677. X      zero = (0.0-pmin) * scale + GAP + 0.5;
  678. X      yoff = pmin - GAP/scale; 
  679. X   }
  680. X   else {
  681. X   /* Make a gap only at the top of the bar graph */
  682. X      range = pmax;
  683. X      scale = (t->ymax - GAP)/range;
  684. X      zero = 0;
  685. X   }
  686. X
  687. X/* Compute the width of the bar graph. */
  688. X   for (bar_cnt=i=0; i < lcnt; ++i)
  689. X      bar_cnt += pnum[i]+1;
  690. X
  691. X   bar_w = t->xmax/bar_cnt;
  692. X
  693. X/* Compute start of first bar. */
  694. X   x_loc = (t->xmax - (bar_cnt-1)*bar_w)/2.0 + 0.5;
  695. X
  696. X#ifdef DEBUG
  697. X   for (i=0; i < lcnt; ++i) {
  698. X      fprintf (stderr, "%d: pval[%d] = ", pnum[i], i*10);
  699. X      for (k=0; k < pnum[i]; ++k) {
  700. X         fprintf (stderr, "%f ", pval[i*10+k]);
  701. X      }
  702. X      fprintf (stderr,"\n");
  703. X   }
  704. X   fprintf (stderr, "lcnt = %d\t", lcnt);
  705. X   fprintf (stderr, "scale = %f\t", scale);
  706. X   fprintf (stderr, "pmax = %f\t", pmax);
  707. X   fprintf (stderr, "pmin = %f\n", pmin);
  708. X   fprintf (stderr, "zero = %d\t", zero);
  709. X   fprintf (stderr, "bar_cnt = %d\n", bar_cnt);
  710. X   fprintf (stderr, "bar_w = %d\n", bar_w);
  711. X   fprintf (stderr, "Hit return\n");
  712. X   (void )getchar();
  713. X#endif
  714. X
  715. X/* Put device into graphics mode. */
  716. X   if (!GTterm_init) {
  717. X      (*t->init)();
  718. X      GTterm_init = TRUE;
  719. X   }
  720. X   (*t->graphics)();  /* Default linetype is 0 (solid line) */
  721. X
  722. X/* Draw a box around the plot. */
  723. X      (*t->move)(0,0);
  724. X      (*t->vector)(0,t->ymax-1);
  725. X      (*t->vector)(t->xmax-1,t->ymax-1);
  726. X      (*t->vector)(t->xmax-1, 0);
  727. X      (*t->vector)(0,0);
  728. X
  729. X/* Draw the zero line. */
  730. X      if (zero != 0) {
  731. X         (*t->move)(x_loc,zero);
  732. X         (*t->vector)(t->xmax-x_loc-1,zero);
  733. X      }
  734. X
  735. X/* Draw lcnt bars of bar_h scale*pval[i] and width bar_w. */
  736. X   for (i = 0; i < lcnt; ++i) {
  737. X      for (k = 0; k < pnum[i]; ++k) {
  738. X         bar_h = (int )((scale * (pval[i*10+k] - yoff)) + 0.5);
  739. X
  740. X#ifdef DEBUG
  741. X         fprintf (stderr, "bar_h = %d, linetype = %d\n", bar_h, k);
  742. X#endif
  743. X   
  744. X         (*t->move)(x_loc,zero);
  745. X         (*t->vector)(x_loc, bar_h);
  746. X         (*t->vector)(x_loc+bar_w, bar_h);
  747. X         (*t->vector)(x_loc+bar_w, zero);
  748. X#ifdef SOLID
  749. X         if (k % 6 < 4) {
  750. X            for (j=0; j < bar_w; ++j) {
  751. X            /* Terminal drivers define points as unsigned int... */
  752. X               (*t->move)(x_loc+j,zero);
  753. X               if (j % (k % 4 + 1) == 0)
  754. X                  (*t->vector)(x_loc+j,bar_h);
  755. X            }
  756. X         }
  757. X         else {
  758. X            int lower, upper;
  759. X            if (zero < bar_h) {
  760. X               lower = zero;
  761. X               upper = bar_h;
  762. X            }
  763. X            else {
  764. X               lower = bar_h;
  765. X               upper = zero;
  766. X            }
  767. X            for (j=lower; j < upper; ++j) {
  768. X               if (j % (k % 3 + 1) == 0) {
  769. X                  (*t->move)(x_loc,j);
  770. X                  (*t->vector)(x_loc+bar_w,j);
  771. X               }
  772. X            }
  773. X         }
  774. X#endif
  775. X         x_loc += bar_w;
  776. X      }
  777. X      x_loc += bar_w;
  778. X   }
  779. X/* Back into text mode (to see the plot generated) */
  780. X   (*t->text)();
  781. X
  782. X}
  783. END_OF_FILE
  784. if test 6602 -ne `wc -c <'bars.c'`; then
  785.     echo shar: \"'bars.c'\" unpacked with wrong size!
  786. fi
  787. # end of 'bars.c'
  788. fi
  789. if test -f 'docu.c' -a "${1}" != "-c" ; then 
  790.   echo shar: Will not clobber existing file \"'docu.c'\"
  791. else
  792. echo shar: Extracting \"'docu.c'\" \(5248 characters\)
  793. sed "s/^X//" >'docu.c' <<'END_OF_FILE'
  794. X#define EOF      -1
  795. X#define MAXLINE 133
  796. X#define TEN         100
  797. X#define MAXTEN    13300
  798. X#define SPACE     3
  799. X#define CP_ int
  800. X
  801. X#include <stdio.h>
  802. X
  803. Xmain(argc, argv)
  804. Xint argc;
  805. XCP_ argv;
  806. X/*-
  807. X   Routine to take stdin and create a document on stdout.  A "document"
  808. X   is all comments lines starting with /*- and ending with
  809. X*/
  810. X/*-
  811. X   In addition, this program will also output up to 10 lines before the
  812. X   /*- comment until a blank line is found (going in reverse up the document).
  813. X*/
  814. X{
  815. X/* Variables
  816. X   comment- Value 0 means no comment seen yet, value 1 comment, value 2 end.
  817. X*/
  818. X   int i, comment, top, end_of_file, empty, blanks, save, nlines;
  819. X   char buffer[MAXTEN];
  820. X
  821. X#ifdef VMS
  822. X   redirect(&argc,argv,0); /*  - redirect standard I/O (from chj) */
  823. X#endif
  824. X
  825. X   if (argc != 1) useage();
  826. X
  827. X   comment = 0;
  828. X   empty   = 0;
  829. X   save    = 0;
  830. X   top     = TEN;
  831. X
  832. X
  833. X   do {
  834. X      end_of_file = fillup (buffer, MAXLINE, TEN, save, &nlines);
  835. X   /* Cycle through the current buffer, locate top. */
  836. X
  837. X      for (top = top + save - TEN, i = save; i < nlines; i++) {
  838. X         test (buffer+MAXLINE*i, MAXLINE, &empty, &comment);
  839. X         if (comment > 0) {
  840. X            for (; top < i; top++)
  841. X               putout (buffer+MAXLINE*top, MAXLINE);
  842. X            top = TEN;
  843. X            putout (buffer+MAXLINE*i, MAXLINE);
  844. X            save = 0;
  845. X         }
  846. X         if (comment == 2) {
  847. X              putspace (SPACE);
  848. X              top = i+1;
  849. X         }
  850. X         if (comment == 0) save++;
  851. X         if (empty && comment == 0) top = i + 1;
  852. X
  853. X      /* Save the least number of lines necessary. */
  854. X         save = TEN - top > save ? save : TEN - top;
  855. X
  856. X      /* Be sure that at least one new line is read in. */
  857. X         save = save >= TEN ? TEN - 1 : save;
  858. X      }
  859. X   } while (end_of_file != EOF);
  860. X
  861. X   exit(0);
  862. X}
  863. X
  864. X
  865. Xdocopy (src, dst, max)
  866. Xchar *src, *dst;
  867. Xint max;
  868. X/*-
  869. X   Routine to copy src to dst up to and including the '\n' character,
  870. X   not more than max characters will be copied, however.
  871. X-*/
  872. X{
  873. X   while (*src != '\n' && max--)
  874. X      *dst++ = *src++;
  875. X   *dst = '\n';
  876. X}
  877. X
  878. X
  879. Xerror (string)
  880. Xchar *string;
  881. X/*-
  882. X   Routine to print a string and then die.
  883. X-*/
  884. X{
  885. X   while (*string) putchar(*string++);
  886. X   putchar('\n');
  887. X}
  888. X
  889. X
  890. Xfillup (buffer, maxline, size, save, nlines)
  891. Xchar *buffer;
  892. Xint maxline, size, save, *nlines;
  893. X/*-
  894. X   Routine to fill a buffer at offsets maxline for size lines from stdin.
  895. X   The buffer will "slide" up by size-save number of lines (eg save = 4 means
  896. X   that the last 4 lines will become the top 4 lines).
  897. X
  898. X   Parameters:
  899. X
  900. X       buffer: maxline*size character array.
  901. X
  902. X      maxline: length of longest line (until a '\n' is seen).
  903. X
  904. X         size: number of lines the buffer can hold.
  905. X
  906. X         save: number of lines from previous buffer to save as top lines
  907. X               of this new buffer.
  908. X
  909. X       nlines: number of active lines in this buffer (returned).
  910. X-*/
  911. X{
  912. X   int line, count;
  913. X   char *ptr;
  914. X
  915. X   line  = 0;
  916. X   count = 0;
  917. X
  918. X/* Save the bottom lines by rearranging them as the top lines. */
  919. X   for (line = 0; line < save; line++)
  920. X      docopy (buffer+maxline*(size-save+line), buffer+maxline*line, maxline);
  921. X
  922. X/* Read in some more lines.  fgets fills in up to maxline characters. */
  923. X   while (line < size && 
  924. X         (ptr = fgets(&buffer[maxline*line++], maxline, stdin)) != NULL);
  925. X
  926. X/* Return the number of active lines in the buffer. */
  927. X   *nlines = line;
  928. X   return (ptr == NULL ? EOF : 1);   /* eof tested in calling routine */
  929. X}
  930. X
  931. X
  932. Xputout (buffer, maxline)
  933. Xchar *buffer;
  934. Xint maxline;
  935. X/*-
  936. X   Routine to put the buffer out to stdout until either maxline is
  937. X   reached or a newline is reached.
  938. X-*/
  939. X{
  940. X   do {
  941. X      putchar (*buffer);
  942. X      if (*buffer++ == '\n')
  943. X         return;
  944. X   } while (maxline--);
  945. X}
  946. X
  947. X
  948. Xputspace (space)
  949. Xint space;
  950. X/*-
  951. X   Routine to put space around each seperate comment block.
  952. X-*/
  953. X{
  954. X   putchar ('\n');
  955. X   while (space--)
  956. X      putchar('-');
  957. X   putchar ('\n');
  958. X}
  959. X
  960. X
  961. Xtest (buffer, maxline, empty, comment)
  962. Xchar *buffer;
  963. Xint maxline, *empty, *comment;
  964. X/*-
  965. X   Routine to test buffer and determine if it is empty (all white space)
  966. X   or if comment should toggle.  Comment is set to 1 when it is 0 and then
  967. X   a run of /*- is seen.  Comment is set to 0 when it is 1 and a closing
  968. X   'C' comment is seen, like this:
  969. X*/
  970. X{
  971. X   if (*comment == 2)
  972. X      *comment = 0;     /* Turn off comment indicator */
  973. X
  974. X   *empty = 1;
  975. X   while (*buffer == ' ' || *buffer == '\t' || *buffer == '\n') {
  976. X      maxline--;
  977. X      if (*buffer == '\n' || maxline == 0)
  978. X         return;
  979. X      buffer++;
  980. X   }
  981. X   
  982. X/* buffer now points at a non-blank character. */
  983. X   *empty = 0;
  984. X
  985. X/* Check to see if start of comment is anywhere on this line. */
  986. X   while (*(buffer+1) != '\n' && maxline > 0) {
  987. X      if (*buffer == '/' && *(buffer+1) == '*' && *(buffer+2) == '-')
  988. X         *comment = 1;
  989. X      if (*comment == 1 && *buffer == '*' && *(buffer+1) == '/')
  990. X         *comment = 2;
  991. X      buffer++;
  992. X      maxline--;
  993. X   }
  994. X}
  995. X
  996. X
  997. Xuseage()
  998. X/*-
  999. X   Explain the useage of docu:
  1000. X
  1001. X   docu <stdin >stdout
  1002. X
  1003. X   (strips document comments out of 'C' code)
  1004. X*/
  1005. X{
  1006. X   static char *mess1 = "docu <stdin >stdout",
  1007. X               *mess2 = "(strips document comments out of 'C' code)";
  1008. X
  1009. X   while (*mess1) putchar (*mess1++);
  1010. X   putchar('\n');
  1011. X   while (*mess2) putchar (*mess2++);
  1012. X   putchar ('\n');
  1013. X   exit(1);
  1014. X}
  1015. END_OF_FILE
  1016. if test 5248 -ne `wc -c <'docu.c'`; then
  1017.     echo shar: \"'docu.c'\" unpacked with wrong size!
  1018. fi
  1019. # end of 'docu.c'
  1020. fi
  1021. if test -f 'getopt.c' -a "${1}" != "-c" ; then 
  1022.   echo shar: Will not clobber existing file \"'getopt.c'\"
  1023. else
  1024. echo shar: Extracting \"'getopt.c'\" \(1552 characters\)
  1025. sed "s/^X//" >'getopt.c' <<'END_OF_FILE'
  1026. X/*
  1027. X * getopt - get option letter from argv
  1028. X *      This software is in the public domain
  1029. X *      Originally written by Henry Spencer at the U. of Toronto
  1030. X */
  1031. X
  1032. X#include <stdio.h>
  1033. X
  1034. Xchar    *optarg;        /* Global argument pointer. */
  1035. Xint     optind = 0;     /* Global argv index. */
  1036. X
  1037. Xstatic char     *scan = NULL;   /* Private scan pointer. */
  1038. X
  1039. X/* extern char     *index();  obsolete, used strchr (JDC). */
  1040. X
  1041. Xint
  1042. Xgetopt(argc, argv, optstring)
  1043. Xint argc;
  1044. Xchar *argv[];
  1045. Xchar *optstring;
  1046. X{
  1047. X        register char c;
  1048. X        register char *place;
  1049. X
  1050. X        optarg = NULL;
  1051. X
  1052. X        if (scan == NULL || *scan == '\0') {
  1053. X                if (optind == 0)
  1054. X                        optind++;
  1055. X
  1056. X                if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
  1057. X                        return(EOF);
  1058. X                if (strcmp(argv[optind], "--")==0) {
  1059. X                        optind++;
  1060. X                        return(EOF);
  1061. X                }
  1062. X
  1063. X                scan = argv[optind]+1;
  1064. X                optind++;
  1065. X        }
  1066. X
  1067. X        c = *scan++;
  1068. X        place = strchr(optstring, c);
  1069. X
  1070. X        if (place == NULL || c == ':') {
  1071. X                fprintf(stderr, "%s: unknown option -%c\n", argv[0], c);
  1072. X                return('?');
  1073. X        }
  1074. X
  1075. X        place++;
  1076. X        if (*place == ':') {
  1077. X                if (*scan != '\0') {
  1078. X                        optarg = scan;
  1079. X                        scan = NULL;
  1080. X                } else {
  1081. X                        optarg = argv[optind];
  1082. X                        optind++;
  1083. X                }
  1084. X        }
  1085. X
  1086. X        return(c);
  1087. X}
  1088. END_OF_FILE
  1089. if test 1552 -ne `wc -c <'getopt.c'`; then
  1090.     echo shar: \"'getopt.c'\" unpacked with wrong size!
  1091. fi
  1092. # end of 'getopt.c'
  1093. fi
  1094. if test -f 'gsr.h' -a "${1}" != "-c" ; then 
  1095.   echo shar: Will not clobber existing file \"'gsr.h'\"
  1096. else
  1097. echo shar: Extracting \"'gsr.h'\" \(3157 characters\)
  1098. sed "s/^X//" >'gsr.h' <<'END_OF_FILE'
  1099. X/* gsr.h  -- header used with Gnuplot graphics support routines. */
  1100. X#ifndef INCgsr
  1101. X#define INCgsr
  1102. X
  1103. X/*-
  1104. X   gnuplot Graphics Support Routines header file.  This file is
  1105. X   required (needs to be included) by users of the gnuplot Graphics 
  1106. X   Support library: gsr.c
  1107. X-*/
  1108. X
  1109. X/* 
  1110. X   Defines required by users of the Gnuplot Graphics Support Routines
  1111. X*/
  1112. X#include <stdio.h>
  1113. X#include <math.h>
  1114. X#ifndef INCgtplot
  1115. X#include "gtplot.h"
  1116. X#endif
  1117. X
  1118. X#ifndef max        /* Lattice C has max() in math.h, but shouldn't! */
  1119. X#define max(a,b) ((a > b) ? a : b)
  1120. X#endif
  1121. X
  1122. X#ifndef min
  1123. X#define min(a,b) ((a < b) ? a : b)
  1124. X#endif
  1125. X
  1126. X
  1127. X/* Gnuplot Graphic Support Routine Globals: */
  1128. X
  1129. X/* File pointer being used by the term routines. */
  1130. X#define GSRoutfile GToutfile
  1131. X
  1132. X#ifdef GSR_OWNER
  1133. X
  1134. X/* Define the boundary of the plot
  1135. X * These are computed at each call to gnu_init(), and are constant over
  1136. X * the period of one plot. They must change when the term
  1137. X * type changes (requiring a call to gnu_init()).
  1138. X */
  1139. Xint GSRxleft, GSRxright, GSRybot, GSRytop;
  1140. XBOOLEAN GSRlogx, GSRlogy;
  1141. X
  1142. X/*
  1143. X   Value where the yaxis is located (used by IMPULSE lines).
  1144. X*/
  1145. Xint GSRxaxis_y;
  1146. X
  1147. X/*
  1148. X   Value of the point and line types in use (especially for gsr_curve())
  1149. X*/
  1150. Xint  GSRpoint_type = 0, GSRline_type = 0;
  1151. X
  1152. X/* Boundary and scale factors, in user coordinates */
  1153. Xdouble GSRxmin, GSRxmax, GSRymin, GSRymax;
  1154. Xdouble GSRxscale, GSRyscale;
  1155. Xfloat GSRxtic, GSRytic;
  1156. Xchar *GSRxformat = "%g", *GSRyformat = "%g";
  1157. X#else
  1158. X
  1159. X/*-
  1160. X   Gnuplot Graphics Support Routine externals (available while using package):
  1161. X
  1162. X   GSRxleft, GSRxright -- location of left, right, top, and bottom sides 
  1163. X   GSRybot, GSRytop       of the plot border in terminal units.
  1164. X
  1165. X   GSRlogx, GSRlogy    -- flags indicating the x or y dimension is log scale.
  1166. X
  1167. X   GSRxaxis_y          -- location of the yaxis (used for IMPULSE plotting).
  1168. X
  1169. X   GSRpoint_type       -- Current point type (usually at least -1 - 6 available)
  1170. X   GSRline_type        -- Current line type  (-2 - 12 on some terminals)
  1171. X
  1172. X   GSRxmin, GSRxmax,   -- maximum and minimum values expected in user
  1173. X   GSRymin, GSRymax       coordinates for X and Y coordinates.
  1174. X
  1175. X   GSRxscale,          -- scaling factors to use to change from user
  1176. X   GSRyscale;             coordinates back to terminal coordinates.
  1177. X
  1178. X   GSRxtic, GSRytic    -- tic width in user coordinates.
  1179. X
  1180. X   GSRxformat,         -- format strings to use with x and y tic values
  1181. X   GSRyformat;            (default is "%g")
  1182. X-*/
  1183. X
  1184. Xextern int GSRxleft, GSRxright, GSRybot, GSRytop;
  1185. Xextern BOOLEAN GSRlogx, GSRlogy;
  1186. Xextern int GSRxaxis_y;
  1187. Xextern int  GSRpoint_type, GSRline_type;
  1188. Xextern double GSRxmin, GSRxmax, GSRymin, GSRymax;
  1189. Xextern double GSRxscale, GSRyscale;
  1190. Xextern float GSRxtic, GSRytic;
  1191. Xextern char *GSRxformat, *GSRyformat;
  1192. X/*- end of GSR external definitions. -*/
  1193. X
  1194. X#endif
  1195. X
  1196. X/*-
  1197. X   gsr_map_x(x)
  1198. X   Macro to map user coordinate x to screen coordinate.
  1199. X
  1200. X   gsr_map_y(y)
  1201. X   Macro to map user coordinate y to screen coordinate.
  1202. X
  1203. X   These macros map from user to terminal coordinates (maps floating
  1204. X   point x or y to screen
  1205. X-*/
  1206. X#define gsr_map_x(x) (int)(GSRxleft+(x-GSRxmin)*GSRxscale+0.5) 
  1207. X#define gsr_map_y(y) (int)(GSRybot+(y-GSRymin)*GSRyscale+0.5)
  1208. X
  1209. X#endif
  1210. END_OF_FILE
  1211. if test 3157 -ne `wc -c <'gsr.h'`; then
  1212.     echo shar: \"'gsr.h'\" unpacked with wrong size!
  1213. fi
  1214. # end of 'gsr.h'
  1215. fi
  1216. if test -f 'gtplot.h' -a "${1}" != "-c" ; then 
  1217.   echo shar: Will not clobber existing file \"'gtplot.h'\"
  1218. else
  1219. echo shar: Extracting \"'gtplot.h'\" \(1872 characters\)
  1220. sed "s/^X//" >'gtplot.h' <<'END_OF_FILE'
  1221. X#ifndef INCgtplot
  1222. X#define INCgtplot
  1223. X
  1224. X/*-
  1225. X   gnuplot Graphics Terminal header file.  This file is required by
  1226. X   all users of the gnuplot Graphics Terminal library: gterm.c
  1227. X-*/
  1228. X#include "plot.h"
  1229. X
  1230. X/* Some key global variables */
  1231. X#ifdef GT_OWNER
  1232. X/* GTterm_tbl[] is "extern" only in the sense that it is defined later... */
  1233. Xextern struct termentry GTterm_tbl[];
  1234. XFILE *GToutfile=NULL;
  1235. XBOOLEAN GTterm_init=0;
  1236. XBOOLEAN GTinteractive=0;  /* Not used correctly yet--who can set it? */
  1237. XBOOLEAN GTcolor=0;  /* Not used yet */
  1238. Xint GTterm=0;
  1239. Xfloat GTxsize = 1.0, GTysize = 1.0, GTzsize = 1.0;  /* z's not used yet */
  1240. X#else
  1241. X
  1242. X/*- 
  1243. X   Globals available when using gterm.c:
  1244. X
  1245. X   GTterm_tbl[]    -  table containing function pointers, etc. for all
  1246. X                      terminal drivers in the gnuplot package.
  1247. X
  1248. X   GToutfile       -  Output file pointer where all plotting activity is
  1249. X                      written out.
  1250. X
  1251. X   GTterm_init     -  Indicates if the terminal has been initialized yet.
  1252. X
  1253. X   GTinteractive   -  Indicates if we are an interactive terminal or not.
  1254. X
  1255. X   GTcolor         -  Not used yet, someday it would be nice to know if we
  1256. X                      are working on a color terminal or not.
  1257. X
  1258. X   GTterm          -  Index into GTterm_tbl describing the current terminal.
  1259. X                      Generally gt_init_teminal() will set this to match the
  1260. X                      GNUTERM environment variable.  The terminal can be
  1261. X                      changed, however, with gt_change_term().
  1262. X   
  1263. X   GTxsize,        -  scaling factors currently only the LaTeX driver can
  1264. X   GTysize            and the postscript driver make use of these.
  1265. X-*/
  1266. X
  1267. Xextern struct termentry GTterm_tbl[];
  1268. Xextern FILE *GToutfile;
  1269. Xextern BOOLEAN GTterm_init;
  1270. Xextern BOOLEAN GTinteractive;
  1271. Xextern BOOLEAN GTcolor;  /* Not used yet */
  1272. Xextern int GTterm;
  1273. Xextern float GTxsize, GTysize;
  1274. X/*--*/
  1275. X
  1276. X/*--*/
  1277. X#endif
  1278. X#endif
  1279. END_OF_FILE
  1280. if test 1872 -ne `wc -c <'gtplot.h'`; then
  1281.     echo shar: \"'gtplot.h'\" unpacked with wrong size!
  1282. fi
  1283. # end of 'gtplot.h'
  1284. fi
  1285. if test -f 'gutil.c' -a "${1}" != "-c" ; then 
  1286.   echo shar: Will not clobber existing file \"'gutil.c'\"
  1287. else
  1288. echo shar: Extracting \"'gutil.c'\" \(5062 characters\)
  1289. sed "s/^X//" >'gutil.c' <<'END_OF_FILE'
  1290. X/* GNUPLOT - util.c */
  1291. X/*
  1292. X * Copyright (C) 1986, 1987, 1990, 1991   Thomas Williams, Colin Kelley
  1293. X *
  1294. X * Permission to use, copy, and distribute this software and its
  1295. X * documentation for any purpose with or without fee is hereby granted, 
  1296. X * provided that the above copyright notice appear in all copies and 
  1297. X * that both that copyright notice and this permission notice appear 
  1298. X * in supporting documentation.
  1299. X *
  1300. X * Permission to modify the software is granted, but not the right to
  1301. X * distribute the modified code.  Modifications are to be distributed 
  1302. X * as patches to released version.
  1303. X *  
  1304. X * This software is provided "as is" without express or implied warranty.
  1305. X * 
  1306. X *
  1307. X * AUTHORS
  1308. X * 
  1309. X *   Original Software:
  1310. X *     Thomas Williams,  Colin Kelley.
  1311. X * 
  1312. X *   Gnuplot 2.0 additions:
  1313. X *       Russell Lang, Dave Kotz, John Campbell.
  1314. X *
  1315. X *   Gnuplot 3.0 additions:
  1316. X *       Gershon Elber and many others.
  1317. X * 
  1318. X * Send your comments or suggestions to 
  1319. X *  pixar!info-gnuplot@sun.com.
  1320. X * This is a mailing list; to join it send a note to 
  1321. X *  pixar!info-gnuplot-request@sun.com.  
  1322. X * Send bug reports to
  1323. X *  pixar!bug-gnuplot@sun.com.
  1324. X */
  1325. X
  1326. X#include <ctype.h>
  1327. X#include <setjmp.h>
  1328. X#include <stdio.h>
  1329. X#include <errno.h>
  1330. X#include "plot.h"
  1331. X
  1332. XBOOLEAN screen_ok;
  1333. X    /* TRUE if command just typed; becomes FALSE whenever we
  1334. X        send some other output to screen.  If FALSE, the command line
  1335. X        will be echoed to the screen before the ^ error message. */
  1336. X
  1337. X#ifndef vms
  1338. X#ifndef __ZTC__
  1339. Xextern int errno;
  1340. Xextern int sys_nerr;
  1341. Xextern char *sys_errlist[];
  1342. X#endif
  1343. X#endif /* vms */
  1344. X
  1345. Xextern char input_line[];
  1346. Xextern struct lexical_unit token[];
  1347. Xextern jmp_buf env;    /* from plot.c */
  1348. Xextern int inline_num;        /* from command.c */
  1349. Xextern BOOLEAN interactive;    /* from plot.c */
  1350. Xextern char *infile_name;    /* from plot.c */
  1351. Xextern int c_token, num_tokens;
  1352. X
  1353. Xextern char *strchr();
  1354. X
  1355. X#ifndef AMIGA_AC_5
  1356. Xextern double sqrt(), atan2();
  1357. X#endif
  1358. X
  1359. X
  1360. X/*
  1361. X * equals() compares string value of token number t_num with str[], and
  1362. X *   returns TRUE if they are identical.
  1363. X */
  1364. Xequals(t_num, str)
  1365. Xint t_num;
  1366. Xchar *str;
  1367. X{
  1368. Xregister int i;
  1369. X
  1370. X    if (!token[t_num].is_token)
  1371. X        return(FALSE);                /* must be a value--can't be equal */
  1372. X    for (i = 0; i < token[t_num].length; i++) {
  1373. X        if (input_line[token[t_num].start_index+i] != str[i])
  1374. X            return(FALSE);
  1375. X        }
  1376. X    /* now return TRUE if at end of str[], FALSE if not */
  1377. X    return(str[i] == '\0');
  1378. X}
  1379. X
  1380. X
  1381. X
  1382. X/*
  1383. X * almost_equals() compares string value of token number t_num with str[], and
  1384. X *   returns TRUE if they are identical up to the first $ in str[].
  1385. X */
  1386. Xalmost_equals(t_num, str)
  1387. Xint t_num;
  1388. Xchar *str;
  1389. X{
  1390. Xregister int i;
  1391. Xregister int after = 0;
  1392. Xregister start = token[t_num].start_index;
  1393. Xregister length = token[t_num].length;
  1394. X
  1395. X    if (!token[t_num].is_token)
  1396. X        return(FALSE);                /* must be a value--can't be equal */
  1397. X    for (i = 0; i < length + after; i++) {
  1398. X        if (str[i] != input_line[start + i]) {
  1399. X            if (str[i] != '$')
  1400. X                return(FALSE);
  1401. X            else {
  1402. X                after = 1;
  1403. X                start--;    /* back up token ptr */
  1404. X                }
  1405. X            }
  1406. X        }
  1407. X
  1408. X    /* i now beyond end of token string */
  1409. X
  1410. X    return(after || str[i] == '$' || str[i] == '\0');
  1411. X}
  1412. X
  1413. X
  1414. X
  1415. Xisstring(t_num)
  1416. Xint t_num;
  1417. X{
  1418. X    
  1419. X    return(token[t_num].is_token &&
  1420. X           (input_line[token[t_num].start_index] == '\'' ||
  1421. X           input_line[token[t_num].start_index] == '\"'));
  1422. X}
  1423. X
  1424. X
  1425. X/*
  1426. X * quote_str() does the same thing as copy_str, except it ignores the
  1427. X *   quotes at both ends.  This seems redundant, but is done for
  1428. X *   efficency.
  1429. X */
  1430. Xquote_str(str, t_num)
  1431. Xchar str[];
  1432. Xint t_num;
  1433. X{
  1434. Xregister int i = 0;
  1435. Xregister int start = token[t_num].start_index + 1;
  1436. Xregister int count;
  1437. X
  1438. X    if ((count = token[t_num].length - 2) > MAX_ID_LEN)
  1439. X        count = MAX_ID_LEN;
  1440. X    if (count>0) {
  1441. X        do {
  1442. X            str[i++] = input_line[start++];
  1443. X            } while (i != count);
  1444. X    }
  1445. X    str[i] = '\0';
  1446. X}
  1447. X
  1448. X
  1449. X/*
  1450. X *    capture() copies into str[] the part of input_line[] which lies between
  1451. X *    the begining of token[start] and end of token[end].
  1452. X */
  1453. Xcapture(str,start,end)
  1454. Xchar str[];
  1455. Xint start,end;
  1456. X{
  1457. Xregister int i,e;
  1458. X
  1459. X    e = token[end].start_index + token[end].length;
  1460. X    for (i = token[start].start_index; i < e && input_line[i] != '\0'; i++)
  1461. X        *str++ = input_line[i];
  1462. X    *str = '\0';
  1463. X}
  1464. X
  1465. X
  1466. Xconvert(val_ptr, t_num)
  1467. Xstruct value *val_ptr;
  1468. Xint t_num;
  1469. X{
  1470. X    *val_ptr = token[t_num].l_val;
  1471. X}
  1472. X
  1473. X
  1474. Xstatic char *num_to_str(r)
  1475. Xdouble r;
  1476. X{
  1477. X    static i = 0;
  1478. X    static char s[4][20];
  1479. X    int j = i++;
  1480. X
  1481. X    if ( i > 3 ) i = 0;
  1482. X
  1483. X    sprintf( s[j], "%g", r );
  1484. X    if ( strchr( s[j], '.' ) == NULL &&
  1485. X         strchr( s[j], 'e' ) == NULL &&
  1486. X         strchr( s[j], 'E' ) == NULL )
  1487. X        strcat( s[j], ".0" );
  1488. X
  1489. X    return s[j];
  1490. X} 
  1491. X
  1492. X
  1493. X
  1494. Xdouble
  1495. Xreal(val)        /* returns the real part of val */
  1496. Xstruct value *val;
  1497. X{
  1498. X    switch(val->type) {
  1499. X        case INT:
  1500. X            return((double) val->v.int_val);
  1501. X        case CMPLX:
  1502. X            return(val->v.cmplx_val.real);
  1503. X    }
  1504. X    int_error("unknown type in real()",NO_CARET);
  1505. X    /* NOTREACHED */
  1506. X    return((double)0.0);
  1507. X}
  1508. X
  1509. Xstruct value *
  1510. Xconst_express(valptr)
  1511. Xstruct value *valptr;
  1512. X{
  1513. X    if (END_OF_COMMAND)
  1514. X        int_error("constant expression required",c_token);
  1515. X
  1516. X/* Cheap imitation, assume there is a well-formed value to avoid evaluate_at */
  1517. X    convert(valptr, c_token);
  1518. X
  1519. X    return(valptr);
  1520. X}
  1521. END_OF_FILE
  1522. if test 5062 -ne `wc -c <'gutil.c'`; then
  1523.     echo shar: \"'gutil.c'\" unpacked with wrong size!
  1524. fi
  1525. # end of 'gutil.c'
  1526. fi
  1527. if test -f 'makefile.3b1' -a "${1}" != "-c" ; then 
  1528.   echo shar: Will not clobber existing file \"'makefile.3b1'\"
  1529. else
  1530. echo shar: Extracting \"'makefile.3b1'\" \(3044 characters\)
  1531. sed "s/^X//" >'makefile.3b1' <<'END_OF_FILE'
  1532. X
  1533. X#
  1534. X# GNUPLOT Makefile for ATT 3b1 (ATT 7300 or the "unix-PC")
  1535. X#
  1536. X# Note: this makefile uses the shared library
  1537. X#
  1538. X
  1539. X# directory where to install executables on 'make install'
  1540. XDEST=/usr/local/lib
  1541. X# directory for installing man page on 'make man_install'
  1542. X# Well, man page needs to be generated out of source code for library
  1543. X# somehow...
  1544. XMANDEST=/usr/man/manl
  1545. X
  1546. X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
  1547. X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset()
  1548. X# -DNOCOPY if you don't have a memcpy() by any name
  1549. X# -O if you trust your compiler's optimizer
  1550. XCC = cc 
  1551. X
  1552. XCFLAGS = -g
  1553. X
  1554. X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
  1555. X# -DAED         AED 512 and AED 767
  1556. X# -DAPOLLO      Apollo workstations
  1557. X# -DBITGRAPH    BBN BitGraph
  1558. X# -DDXY800A     Roland DXY800A plotter
  1559. X# -DEPSON               Epson LX-800, Star NL-10, NX-1000 and lots of others
  1560. X# -DFIG                 Fig graphics language (requires object.h from TransFig)
  1561. X# -DHP2648              HP2648, HP2647
  1562. X# -DHP26        HP2623A and maybe others
  1563. X# -DHP75        HP7580, and probably other HPs
  1564. X# -DHPGL                HP7475 and (hopefully) lots of others
  1565. X# -DHPLJET              HP Laserjet
  1566. X# -DIMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  1567. X# -DIRIS4D      IRIS4D series computer
  1568. X# -DKERMIT      MS-Kermit Tektronix 4010 emulator
  1569. X# -DLATEX       LATEX picture environment
  1570. X# -DPOSTSCRIPT  Postscript
  1571. X# -DPROPRINTER  IBM Proprinter
  1572. X# -DQMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  1573. X# -DREGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  1574. X# -DSELANAR     Selanar
  1575. X# -DTEK         Tektronix 4010, and probably others
  1576. X# -DSUN         Sun Microsystems Workstation
  1577. X# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
  1578. X# -DUNIXPLOT    unixplot
  1579. X# -DV384        Vectrix 384 and tandy color printer
  1580. X
  1581. XTERMFLAGS =  -I../term -DHPLJET -DNEC -DUNIXPC
  1582. X#TERMFLAGS =  -I../term -DHPLJET -DNEC -DUNIXPLOT -DUNIXPC
  1583. X#TERMFLAGS =  -I../term -DUNIXPC
  1584. X
  1585. X# These object files form the gplotlib.ar library
  1586. XOBJS = gsr.o gterm.o 
  1587. X
  1588. X# -lplot iff you have -DUNIXPLOT
  1589. X# -lsuntool -lsunwindow -lpixrect  iff you have -DSUN
  1590. X# -lgl_s if IRIS4D
  1591. XLIBS = -lm -lplot
  1592. X
  1593. Xbar: $(OBJS) bar.o
  1594. X    ld /lib/crt0s.o /lib/shlib.ifile bar.o $(OBJS) $(LIBS) -o bar
  1595. X
  1596. Xbars: $(OBJS) bars.o
  1597. X    ld /lib/crt0s.o /lib/shlib.ifile bars.o $(OBJS) $(LIBS) -o bars
  1598. X
  1599. Xpie: $(OBJS) pie.o
  1600. X    ld /lib/crt0s.o /lib/shlib.ifile pie.o $(OBJS) $(LIBS) -o pie 
  1601. X
  1602. Xall:    bar pie
  1603. X
  1604. Xgterm.o: ../term/*.trm gterm.c
  1605. X    $(CC) $(CFLAGS) $(TERMFLAGS) -c gterm.c
  1606. X
  1607. X$(OBJS): gtplot.h gsr.h
  1608. X
  1609. Xclean:
  1610. X    rm -f *.o *~ ../term/*~ *.*_doc 
  1611. X
  1612. Xspotless:
  1613. X    rm -f *.o *~ ../term/*~ TAGS bar bars pie cpr docu *.*_doc gplotlib.doc
  1614. X
  1615. Xdoc:    docu cpr intro.doc gsr.c gsr.h gterm.c gtplot.h
  1616. X    docu <gsr.c >gsr.c_doc
  1617. X    docu <gsr.h >gsr.h_doc
  1618. X    docu <gterm.c >gterm.c_doc
  1619. X    docu <gtplot.h >gtplot.h_doc
  1620. X    cpr -ac -C -PBACKSPACE \
  1621. X       intro.doc gterm.c_doc gtplot.h_doc gsr.c_doc gsr.h_doc >gplotlib.doc
  1622. X    rm -f gsr.c_doc gsr.h_doc gterm.c_doc gtplot.h_doc
  1623. X
  1624. Xdocu:    docu.c
  1625. X    cc docu.c -o docu
  1626. X
  1627. Xcpr:    cpr.c
  1628. X    cc cpr.c -o cpr
  1629. X
  1630. END_OF_FILE
  1631. if test 3044 -ne `wc -c <'makefile.3b1'`; then
  1632.     echo shar: \"'makefile.3b1'\" unpacked with wrong size!
  1633. fi
  1634. # end of 'makefile.3b1'
  1635. fi
  1636. if test -f 'makefile.ult' -a "${1}" != "-c" ; then 
  1637.   echo shar: Will not clobber existing file \"'makefile.ult'\"
  1638. else
  1639. echo shar: Extracting \"'makefile.ult'\" \(3338 characters\)
  1640. sed "s/^X//" >'makefile.ult' <<'END_OF_FILE'
  1641. X#
  1642. X# GPLOTLIB Makefile for Ultrix
  1643. X#
  1644. X# Note: Ultrix standard cc compiler has a bug with static structure
  1645. X# initializations [such as struct ts {int x;} tb[]={{100*0.32}};]
  1646. X# and so this makefile uses vcc instead.  If this isn't possible,
  1647. X# and you get "line xx: illegal initialization", then you'll have
  1648. X# to go into the .trm include file and compute all the floating point
  1649. X# defines with a calculator.
  1650. X
  1651. X
  1652. X# directory where to install executables on 'make install'
  1653. XDEST=/usr/local/lib
  1654. X# directory for installing man page on 'make man_install'
  1655. X# Well, man page needs to be generated out of source code for library
  1656. X# somehow...
  1657. XMANDEST=/usr/man/manl
  1658. X
  1659. X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
  1660. X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset()
  1661. X# -DNOCOPY if you don't have a memcpy() by any name
  1662. X# -O if you trust your compiler's optimizer
  1663. XCC = cc 
  1664. X
  1665. XCFLAGS = -DBCOPY -DBZERO -O #-gx 
  1666. X
  1667. X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
  1668. X# -DAED         AED 512 and AED 767
  1669. X# -DAPOLLO      Apollo workstations
  1670. X# -DBITGRAPH    BBN BitGraph
  1671. X# -DDXY800A     Roland DXY800A plotter
  1672. X# -DEPSON               Epson LX-800, Star NL-10, NX-1000 and lots of others
  1673. X# -DFIG                 Fig graphics language (requires object.h from TransFig)
  1674. X# -DHP2648              HP2648, HP2647
  1675. X# -DHP26        HP2623A and maybe others
  1676. X# -DHP75        HP7580, and probably other HPs
  1677. X# -DHPGL                HP7475 and (hopefully) lots of others
  1678. X# -DHPLJET              HP Laserjet
  1679. X# -DIMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  1680. X# -DIRIS4D      IRIS4D series computer
  1681. X# -DKERMIT      MS-Kermit Tektronix 4010 emulator
  1682. X# -DLATEX       LATEX picture environment
  1683. X# -DPOSTSCRIPT  Postscript
  1684. X# -DPROPRINTER  IBM Proprinter
  1685. X# -DQMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  1686. X# -DREGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  1687. X# -DSELANAR     Selanar
  1688. X# -DTEK         Tektronix 4010, and probably others
  1689. X# -DSUN         Sun Microsystems Workstation
  1690. X# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
  1691. X# -DUNIXPLOT    unixplot
  1692. X# -DV384        Vectrix 384 and tandy color printer
  1693. X
  1694. X# -DEPSON removed just before HP2648.
  1695. X
  1696. XTERMFLAGS =  -I../term -DAED -DBITGRAPH -DDXY800A -DHP2648 \
  1697. X    -DHP26 -DHP75 -DHPGL -DHPLJET -DIMAGEN -DKERMIT -DLATEX \
  1698. X    -DPOSTSCRIPT -DPROPRINTER -DQMS -DREGIS -DSELANAR -DTEK \
  1699. X    -DUNIXPLOT -DV384
  1700. X
  1701. X# These object files form the gplotlib.ar library
  1702. XOBJS = gsr.o gterm.o 
  1703. X
  1704. X# -lplot iff you have -DUNIXPLOT
  1705. X# -lsuntool -lsunwindow -lpixrect  iff you have -DSUN
  1706. X# -lgl_s if IRIS4D
  1707. XLIBS = -lm -lplot
  1708. X
  1709. Xbar: $(OBJS) bar.o
  1710. X    vcc bar.o $(OBJS) $(LIBS) -o bar
  1711. X
  1712. Xbars: $(OBJS) bars.o
  1713. X    vcc bars.o $(OBJS) $(LIBS) -o bar
  1714. X
  1715. Xpie: $(OBJS) pie.o
  1716. X    vcc pie.o $(OBJ) $(LIBS) -o bar
  1717. X
  1718. Xall:    bar pie
  1719. X
  1720. Xgterm.o: ../term/*.trm gterm.c
  1721. X    vcc $(CFLAGS) $(TERMFLAGS) -c gterm.c
  1722. X
  1723. X$(OBJS): gtplot.h gsr.h
  1724. X
  1725. Xclean:
  1726. X    rm -f *.o *~ *.*_doc 
  1727. X
  1728. Xspotless:
  1729. X    rm -f *.o *~ TAGS bar bars pie cpr docu *.*_doc gplotlib.doc
  1730. X
  1731. Xdoc:    docu cpr intro.doc gsr.c gsr.h gterm.c gtplot.h
  1732. X    docu <gsr.c >gsr.c_doc
  1733. X    docu <gsr.h >gsr.h_doc
  1734. X    docu <gterm.c >gterm.c_doc
  1735. X    docu <gtplot.h >gtplot.h_doc
  1736. X    cpr -ac -C -PBACKSPACE \
  1737. X       intro.doc gterm.c_doc gtplot.h_doc gsr.c_doc gsr.h_doc >gplotlib.doc
  1738. X    rm -f gsr.c_doc gsr.h_doc gterm.c_doc gtplot.h_doc
  1739. X
  1740. Xdocu:    docu.c
  1741. X    cc docu.c -o docu
  1742. X
  1743. Xcpr:    cpr.c
  1744. X    cc cpr.c -o cpr
  1745. END_OF_FILE
  1746. if test 3338 -ne `wc -c <'makefile.ult'`; then
  1747.     echo shar: \"'makefile.ult'\" unpacked with wrong size!
  1748. fi
  1749. # end of 'makefile.ult'
  1750. fi
  1751. if test -f 'makefile.unx' -a "${1}" != "-c" ; then 
  1752.   echo shar: Will not clobber existing file \"'makefile.unx'\"
  1753. else
  1754. echo shar: Extracting \"'makefile.unx'\" \(2639 characters\)
  1755. sed "s/^X//" >'makefile.unx' <<'END_OF_FILE'
  1756. X#
  1757. X# GPLOTLIB Makefile for Unix machines
  1758. X#
  1759. X
  1760. X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
  1761. X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset()
  1762. X# -DNOCOPY if you don't have a memcpy() by any name
  1763. X# -O if you trust your compiler's optimizer
  1764. XCC = cc 
  1765. X
  1766. XCFLAGS = -I.. -DBCOPY -DBZERO -O #-gx 
  1767. X
  1768. X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
  1769. X# -DAED         AED 512 and AED 767
  1770. X# -DAPOLLO      Apollo workstations
  1771. X# -DBITGRAPH    BBN BitGraph
  1772. X# -DDXY800A     Roland DXY800A plotter
  1773. X# -DEPSON               Epson LX-800, Star NL-10, NX-1000 and lots of others
  1774. X# -DFIG                 Fig graphics language (requires object.h from TransFig)
  1775. X# -DHP2648              HP2648, HP2647
  1776. X# -DHP26        HP2623A and maybe others
  1777. X# -DHP75        HP7580, and probably other HPs
  1778. X# -DHPGL                HP7475 and (hopefully) lots of others
  1779. X# -DHPLJET              HP Laserjet
  1780. X# -DIMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  1781. X# -DIRIS4D      IRIS4D series computer
  1782. X# -DKERMIT      MS-Kermit Tektronix 4010 emulator
  1783. X# -DLATEX       LATEX picture environment
  1784. X# -DPOSTSCRIPT  Postscript
  1785. X# -DPROPRINTER  IBM Proprinter
  1786. X# -DQMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  1787. X# -DREGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  1788. X# -DSELANAR     Selanar
  1789. X# -DTEK         Tektronix 4010, and probably others
  1790. X# -DSUN         Sun Microsystems Workstation
  1791. X# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
  1792. X# -DUNIXPLOT    unixplot
  1793. X# -DV384        Vectrix 384 and tandy color printer
  1794. X
  1795. X# -DEPSON removed just before HP2648.
  1796. X
  1797. XTERMFLAGS =  -I.. -I../term -DUNIXPLOT 
  1798. X
  1799. X# These object files form the gplotlib.ar library
  1800. XOBJS = gsr.o bitmap.o gterm.o
  1801. X
  1802. X# -lplot iff you have -DUNIXPLOT
  1803. X# -lsuntool -lsunwindow -lpixrect  iff you have -DSUN
  1804. X# -lgl_s if IRIS4D
  1805. XLIBS = -lm -lplot
  1806. X
  1807. Xbar: $(OBJS) bar.o
  1808. X    cc bar.o $(OBJS) $(LIBS) -o bar
  1809. X
  1810. Xbars: $(OBJS) bars.o
  1811. X    cc bars.o $(OBJS) $(LIBS) -o bar
  1812. X
  1813. Xpie: $(OBJS) pie.o
  1814. X    cc pie.o $(OBJ) $(LIBS) -o bar
  1815. X
  1816. Xall:    bar pie
  1817. X
  1818. Xgterm.o: ../term/*.trm gterm.c
  1819. X    cc $(CFLAGS) $(TERMFLAGS) -c gterm.c
  1820. X
  1821. Xbitmap.o: ../bitmap.c
  1822. X    cc $(CFLAGS) -c ../bitmap.c
  1823. X
  1824. X$(OBJS): gtplot.h gsr.h
  1825. X
  1826. Xclean:
  1827. X    rm -f *.o *~ *.*_doc 
  1828. X
  1829. Xspotless:
  1830. X    rm -f *.o *~ TAGS bar bars pie cpr docu *.*_doc gplotlib.doc
  1831. X
  1832. Xdoc:    docu cpr intro.doc gsr.c gsr.h gterm.c gtplot.h
  1833. X    docu <gsr.c >gsr.c_doc
  1834. X    docu <gsr.h >gsr.h_doc
  1835. X    docu <gterm.c >gterm.c_doc
  1836. X    docu <gtplot.h >gtplot.h_doc
  1837. X    cpr -ac -C -PBACKSPACE \
  1838. X       intro.doc gterm.c_doc gtplot.h_doc gsr.c_doc gsr.h_doc >gplotlib.doc
  1839. X    rm -f gsr.c_doc gsr.h_doc gterm.c_doc gtplot.h_doc
  1840. X
  1841. Xdocu:    docu.c
  1842. X    cc docu.c -o docu
  1843. X
  1844. Xcpr:    cpr.c
  1845. X    cc cpr.c -o cpr
  1846. END_OF_FILE
  1847. if test 2639 -ne `wc -c <'makefile.unx'`; then
  1848.     echo shar: \"'makefile.unx'\" unpacked with wrong size!
  1849. fi
  1850. # end of 'makefile.unx'
  1851. fi
  1852. echo shar: End of archive 1 \(of 5\).
  1853. cp /dev/null ark1isdone
  1854. MISSING=""
  1855. for I in 1 2 3 4 5 ; do
  1856.     if test ! -f ark${I}isdone ; then
  1857.     MISSING="${MISSING} ${I}"
  1858.     fi
  1859. done
  1860. if test "${MISSING}" = "" ; then
  1861.     echo You have unpacked all 5 archives.
  1862.     rm -f ark[1-9]isdone
  1863. else
  1864.     echo You still need to unpack the following archives:
  1865.     echo "        " ${MISSING}
  1866. fi
  1867. ##  End of shell archive.
  1868. exit 0
  1869.  
  1870.